import { getStorage, storePasted, setStoreTime } from '@/utils/storage'
import { setUsers } from '@/api/user'
const mockData = [
  {
    name: '沈阳阳',
    email: 'shengyang@gmail.com',
    age: '',
    role: 'parent', // parent, child, younger， child: 7-11岁，younger: 11-14岁
    number: '1',
    password: '1',
    avatar: 'https://aha-public-1301319986.cos.ap-shanghai.myqcloud.com/static_file/yuping/userAvatar/20220308094833150-Ellipse 13.png',
    avatarLarge: 'https://aha-public-1301319986.cos.ap-shanghai.myqcloud.com/static_file/yuping/userAvatar/20220312153807850-Ellipse 13 (3).png',
    sex: 1, // 1: 男, 0: 女
    toys: [1, 2], // 选择的玩具id
    interest: [1, 2], // 选择感兴趣的改造方向
  },
  {
    name: '沈大阳',
    email: 'shengdyang@gmail.com',
    age: 12,
    role: 'younger', // parent, child, younger， child: 7-11岁，younger: 11-14岁
    number: '2',
    password: '1',
    avatar: 'https://aha-public-1301319986.cos.ap-shanghai.myqcloud.com/static_file/yuping/userAvatar/20220308094833149-Ellipse 13 (1).png',
    avatarLarge: 'https://aha-public-1301319986.cos.ap-shanghai.myqcloud.com/static_file/yuping/userAvatar/20220312162743943-Ellipse 14 (1).png',
    sex: 0, // 1: 男, 0: 女
    toys: [1, 2], // 选择的玩具id
    interest: [1, 2], // 选择感兴趣的改造方向
  },
  {
    name: '沈小阳',
    email: 'shengxyang@gmail.com',
    age: 8,
    role: 'child', // parent, child, younger， child: 7-11岁，younger: 11-14岁
    number: '3',
    password: '1',
    avatar: 'https://aha-public-1301319986.cos.ap-shanghai.myqcloud.com/static_file/yuping/userAvatar/20220312155002186-Ellipse 15.png',
    avatarLarge: 'https://aha-public-1301319986.cos.ap-shanghai.myqcloud.com/static_file/yuping/userAvatar/20220312155002186-Ellipse 15.png',
    sex: 1, // 1: 男, 0: 女
    toys: [1, 2], // 选择的玩具id
    interest: [1, 2], // 选择感兴趣的改造方向
  },
]

/* 初始化本地数据 */
if (storePasted()) {
  setUsers(mockData)
  console.log('重新缓存用户')
  setTimeout(() => {
    setStoreTime()
    console.log('缓存完成')
  }, 5000)
}
